package frame.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BaseController extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // �ع����ͻ��˱��봫method����
        // 1����ȡ����������ʶ���û�������ķ���
        // 2��Ȼ���ж����ĸ�����������һ�����Ƿ������Ǿ͵�����һ������
        String methodName = req.getParameter("method");
        if (methodName.equals("addUser")) {
            addUser(req, resp);
        } else if (methodName.equals("deleteUser")) {
            deleteUser(req, resp);
        } else if (methodName.equals("updateUser")) {
            updateUser(req, resp);
        } else if (methodName.equals("queryUser")) {
            queryUser(req, resp);
        } else if (methodName.equals("queryAllUser")) {
            queryAllUser(req, resp);
        } else if (methodName.equals("queryNmaeUser")) {
            queryNmaeUser(req, resp);
        }

    }

    public void queryNmaeUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("-----F---queryNmaeUser--------");

    }

    public void queryAllUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("-----F---queryAllUser--------");
    }

    public void queryUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("-----F---queryUser--------");
    }

    public void updateUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("-----F---updateUser--------");
    }

    public void deleteUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("-----F---deleteUser--------");
    }

    public void addUser(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("-----F---addUser--------");
    }
}
